package com.justplay.mobilelocation.sms;

import android.content.Context;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Handler;

public class SMSObserver extends ContentObserver {
	private Context mContext;

	public SMSObserver(Context context) {
		super(new Handler());
		mContext = context;
		mContext.getContentResolver().registerContentObserver(Uri.parse("content://sms/"), true, this);
	}

	@Override
	public void onChange(boolean bSelfChange) {
		super.onChange(bSelfChange);

	/*	Uri uri = Uri.parse("content://sms/inbox");
		Cursor c = mContext.getContentResolver().query(uri, null, null, null, null);
		while (c.moveToNext()) {
			SmsUtils.handlerSms(mContext, c.getString(c.getColumnIndex("address")), c.getString(c.getColumnIndex("body")));
			// Delete the SMS
			String uri2 = "content://sms/conversations/" + c.getString(1);
			mContext.getContentResolver().delete(Uri.parse(uri2), null, null);
		}*/

	}
}
